Deleting buffers in DXL attribute

Hi,

I was wondering how DOORS calculates DXL Attributes. Can the leaked memory be transfered from one object to another during calculation? Or does each object's attribute has own memory space? Each has own stack and heap, being created and destroyed with each object-attribute value calculation?

Example:

Buffer b = create()
b = "qwertyuiop"
obj.attrDXLName = tempStringOf(b)
delete(b) // (1)

 


Is there any difference if I would not write (1) line (except of course puristic approach)?

BR,
Jarek

 


SystemAdmin - Fri Jan 28 10:55:02 EST 2011

Re: Deleting buffers in DXL attribute
Mathias Mamsch - Fri Jan 28 11:06:04 EST 2011

For each object the attribute DXL is executed in its own DXL context, and after the calculation the memory is invalidated. Normally you should not be able to leak memory in an attribute DXL since all memory that is associated with a DXL context is freed after the DXL program of that context has ended. You can try yourself by writing
 

// you can also fill up this buffer, you will get no memory rise
        Buffer b = create(10000000)

 


in a Layout DXL or Attribute DXL. You will get no memory exhaustion by that. Making the memory stay alive is really hard, but Louie had a clever solution. Use a module and object DXL attribute, store some values you will be needing in the module attribute part and then use that value in the calculation of the object attribute dxl.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Deleting buffers in DXL attribute
SystemAdmin - Mon Jan 31 11:57:18 EST 2011

Hi,

Thanks for thorough explanation.

Jarek